package cn.stylefeng.guns.sys.modular.system.db2.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.sys.modular.system.db2.model.params.BusinessParam;
import cn.stylefeng.guns.sys.modular.system.model.params.ProDataViewParam;
import cn.stylefeng.guns.sys.modular.system.model.result.ShopDataResult;
import cn.stylefeng.roses.core.reqres.response.ResponseData;

import java.text.ParseException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author jiangge
 * @since 2020-10-27
 */
public interface BusinessService {

    /**
     * 营业额
     *
     * @author jiangge
     * @Date 2020-10-28
     */
    LayuiPageInfo findPageBySpec(BusinessParam param);

    /**
     * 营业-营业收入、就餐人数、客单数
     *
     * @return
     */
    ResponseData findBusinessData(ProDataViewParam param) throws ParseException;

    /**
     * 堂食-营业收入、就餐人数、客单数
     *
     * @return
     */
    ResponseData findBusinessDataOfDineIn(ProDataViewParam param) throws ParseException;

    /**
     * 外卖-营业收入、就餐人数、客单数
     *
     * @return
     */
    ResponseData findBusinessDataOfTakeAway(ProDataViewParam param) throws ParseException;
    /**
     * 近几天的营业数据
     *
     * @param param
     * @return
     * @throws ParseException
     */
    LinkedHashMap<String, Object> findRecentDaysBusinessData(ProDataViewParam param) throws ParseException;

    /**
     * 营业额排序
     *
     * @param param
     * @return
     */
    List<Map<String, Object>> findBusinessDataOrderByIncome(ProDataViewParam param);

    ShopDataResult findBusinessDataWithIncomeTotalOrderByIncome(ProDataViewParam param);
    /**
     * 营业额排序2
     *
     * @param param
     * @return
     */
    ShopDataResult findShopsIncomeByTimeScope(ProDataViewParam param);
    /**
     * 客流量排序
     *
     * @param param
     * @return
     */
    List<Map<String, Object>> findBusinessDataOrderByPeopleQty(ProDataViewParam param);

    /**
     * 新店首日营业数据
     * @param param
     * @return
     */
    List<Map<String, Object>> findBusinessDataOfFirstDay(ProDataViewParam param,  List<Map<String, Object>> dataResultList);

    /**
     * 客流量数据
     * @param param
     * @return
     */
    List<Map<String, Object>> findPeopleQtyByParam(ProDataViewParam param);

    /**
     * 外卖主食数据
     * @param param
     * @return
     */
    List<Map<String, Object>> findTakeawayRiceDataByParam(ProDataViewParam param);
}
